<script>
	export default {
		onLaunch: function(e) {
			uni.hideTabBar();
			console.log(e.query.rid)
			let parentCode="XH124x3U"
			if(this.$user.state.token==''||this.$user.state.token==undefined){
				if(e.query.rid!=undefined){
					parentCode=e.query.rid
				}
				this.login.Login(parentCode)
			}
			
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		},
		
		methods:{
			//打开
			open(type,id,lei){
				switch (type){
					case "search":
						uni.navigateTo({
							url:'/pagesB/search/search'
						})
					break;
					case "position":
						uni.navigateTo({
							url:'/pagesB/address/positioning'
						})
					break
					case "shop":
						if(lei==1){
							uni.navigateTo({
								url:'/pagesC/shop/fuShop?id='+id
							})
						}else{
							uni.navigateTo({
								url:'/pagesC/shop/shop?id='+id
							})
						}
					break
					case "group":
						uni.navigateTo({
							url:'/pagesB/group/group?id='+id
						})
					break
					case "yue":
						uni.navigateTo({
							url:'/pagesC/balance/balance'
						})
					break
					case "score":
						uni.navigateTo({
							url:'/pagesC/score/score'
						})
					break
					case "coupon":
						uni.navigateTo({
							url:'/pagesC/coupon/coupon'
						})
					break
					case "exchange":
						uni.navigateTo({
							url:'/pagesC/coupon/exchange'
						})
					break
					case "couponShow":
						uni.navigateTo({
							url:'/pagesC/coupon/couponShow'
						})
					break
					case "giftPack":
						uni.navigateTo({
							url:'/pagesC/coupon/giftPack'
						})
					break
					case "balance":
						uni.navigateTo({
							url:'/pagesC/balance/balance'
						})
					break
					case "cate":
						uni.switchTab({
							url:'/pages/cate/cate'
						})
					break
					case "news":
						uni.navigateTo({
							url:'/pagesC/news/news?id='+id
						})
					break
					case "newsCate":
						uni.navigateTo({
							url:'/pagesC/news/news_cate?id='+id
						})
					break
				}
			},
			//打开banner
			openBanner(type,url,id,url_type){
				switch (type){
					case 3:
					const one={
						url:id
					}
						uni.navigateTo({
							url:'/pagesB/webH5/webH5?url='+one
						})
						break;
					case 1:
						if(url_type==1){
							uni.switchTab({
								url:url
							})
						}else{
							uni.navigateTo({
								url:url
							})
						}
						break;
					case 2:
						uni.navigateTo({
							url:url+parseFloat(id)
						})
					break;
				}
			},
		}
	}
</script>
<style>
	/*每个页面公共css */
	/*每个页面公共css */
	@import './common/ljm-main.css';
	@import './common/uni.min.css';
	/* 解决小程序和app滚动条的问题 */
	/* 在线链接服务仅供平台体验和调试使用，平台不承诺服务的稳定性，企业客户需下载字体包自行发布使用并做好备份。 */
	@font-face {
	  font-family: 'iconfont';  /* Project id 3241007 */
	  src: url('//at.alicdn.com/t/c/font_3241007_2676aecgqaaj.woff2?t=1695371535228') format('woff2'),
	       url('//at.alicdn.com/t/c/font_3241007_2676aecgqaaj.woff?t=1695371535228') format('woff'),
	       url('//at.alicdn.com/t/c/font_3241007_2676aecgqaaj.ttf?t=1695371535228') format('truetype');
	}
	/* #ifdef MP-WEIXIN || APP-PLUS */
	view::-webkit-scrollbar{
	      display: none;
		  width:0 !important;
		  height: 0 !important;
		  -webkit-appearance: none;
		  background: transparent;
		  color: transparent;
	}
	 
	img{
		width: 100%;
		display: block;
	}
	image{
		width: 100%;
		display: block;
	}
	/* #endif */
	/* 解决H5 的问题 */
	/* #ifdef H5 */
	uni-scroll-view .uni-scroll-view::-webkit-scrollbar {
	    /* 隐藏滚动条，但依旧具备可以滚动的功能 */
		display: none;
		width:0 !important;
		height: 0 !important;
		-webkit-appearance: none;
		background: transparent;
		color: transparent;
	}
	/* #endif */
	/* #ifndef APP-NVUE */  
	body{  
	    background-color: rgba(0,0,0,0);  
	}  
	/* #endif */ 
	body{
	    background-color: transparent;  
	}  
	/* 清除元素的内外边距默认为0 */
	* {
	  margin: 0;
	  padding: 0;
	  box-sizing: border-box;
	}
</style>
